<?php
/*
 * Admin���鹫������������Ҫ��֤��ͨ����
 */
class AdminAction extends CmsAction {
	public function _initialize() {
		parent::_initialize ();
		// ��̨�û�Ȩ�޼��
		if (C ( 'USER_AUTH_ON' ) && ! in_array ( MODULE_NAME, explode ( ',', C ( 'NOT_AUTH_MODULE' ) ) )) {
			import ( 'ORG.Util.RBAC' );
			if (! RBAC::AccessDecision ()) {
				// �����֤ʶ���
				if (! $_SESSION [C ( 'USER_AUTH_KEY' )]) {
					// ��ת����֤���
					redirect ( PHP_FILE . C ( 'USER_AUTH_GATEWAY' ) );
				}
				// û��Ȩ�� �׳����
				if (C ( 'RBAC_ERROR_PAGE' )) {
					// ����Ȩ�޴���ҳ��
					redirect ( C ( 'RBAC_ERROR_PAGE' ) );
				} else {
					if (C ( 'GUEST_AUTH_ON' )) {
						$this->assign ( 'jumpUrl', PHP_FILE . C ( 'USER_AUTH_GATEWAY' ) );
					}
					// ��ʾ������Ϣ
					$this->error ( L ( '_VALID_ACCESS_' ) );
				}
			}
		}
	}
}